<template>
    <div id="modifyPhoneNumber" class="person-detail">
        <div>
            <van-nav-bar
                title="修改手机号"
                :fixed="true"
                left-arrow
                @click-left="back"
                />
        </div>
        <div style="background:#fff;">
            <p class="opacity">为了账号安全性，请输入当前用户的密码登录验证，验证通过即可修改手机号</p>
            <p class="modifyPhoneNumber-passowrd">
                <svg-icon icon-class="修改手机号-密码" widthW="1em" heightH="1em"></svg-icon>
                密码验证
            </p>
            <van-cell-group>
                <van-field
                    v-model="sms"
                    center
                    clearable
                    type="password"
                    placeholder="请输入当前用户的密码"
                >
                </van-field>
            </van-cell-group>
            <van-button type="info" :disabled="isSendMessage" class="next-step-button" @click="confirm()" :style="isSendMessage?'background:#999999;':''">下一步</van-button>
        </div>
    </div>
</template>
<script>
import mine from "../../../controller/mine";
import md5 from "js-md5";
export default {
    name: 'modifyPhoneNumber',
    components: {},
    data() {
        return {
            isSendMessage:false,
            sms:''
        }
    },
    computed: {

    },
    created() {},
    mounted() {},
    methods: {
        sendMessage(){
            this.isSendMessage = false
        },
        back(){
             this.$router.go(-1)
        },
        confirm(){
            mine.security_v1_validatePassword(md5(this.sms.toString())).then(res=>{
                if(res.code === '0'){
                    this.$router.push({ path:'/person/bindPhoneNumber'})
                }
                else{
                    this.$toast("密码不正确")
                }
            })
        }
    }
}
</script>
<style lang="scss" scoped>
#modifyPhoneNumber>div:nth-child(2){
    text-align: center;
    >p:nth-child(1){
        margin: 0;
        word-wrap: break-word;
        word-break: break-all;
        overflow: hidden;
    }
    .modifyPhoneNumber-passowrd{
        margin: 0;
        text-align: left;
        padding: 40px 35px 20px 35px;
        font-size: 16px;
    }
    .van-cell-group{
        padding: 0 20px;
        color: #BFC2CC;
    }
    
}

</style>
<style lang="scss">
@import '../style/index.scss';
</style>

